// Supplemental appendix regressions
// Low skill products by high skill workers
// Micro analysis
// Author: Erica Owen


version 14.2
use "mow_micro_rep.dta", clear


// Table A3 Non material sources of support for globalization
// DV 2: Support for trade & FDI

* america_cult traditional not_marg CT1_eo news

local z  i.bach  i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
local x1  c.reled
local x2 c.lnreal
local c if lforce==1 & imf_adv==0  

local y melogit support
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_1


local y melogit support
 `y' `x1'##`x2' CT1_eo `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_2


local y melogit support
 `y' `x1'##`x2' america_cult `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_3

local y melogit support
 `y' `x1'##`x2' traditional `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_4

local y melogit support
 `y' `x1'##`x2' national `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_5

local y melogit support
 `y' `x1'##`x2' news `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_6


local y melogit support
 `y' `x1'##`x2' socio_enr `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_7


// Table a4 - margalit replication
// See XXX

// Table A5 Control for different sectoral exports
// DV 1: Relative income


est drop _all

local z i.female age i.unemp i.bach  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local c if lforce==1 & imf_adv==0  

local x2 c.manufexp
local x3 c.fuelexp
local x4 c.agrexp
local x5 c.foodexp
local y pctusdinc

forvalues i=2/5 {
	mixed `y' `x1'##`x`i'' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
	est sto m`i'
	}


 
  
  
// Table A6
// DV 2: Support for trade & FDI

est drop _all




local z  i.bach i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
local x1  c.reled
local c if lforce==1 & imf_adv==0  

local x2 c.manufexp
local x3 c.fuelexp
local x4 c.agrexp
local x5 c.foodexp

forvalues i=2/5 {
 melogit support  `x1'##`x`i''  `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
	est sto m`i'
	}

  
 // Table A7
 
est drop _all


local z i.bach i.female age i.unemp  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local x2 c.lnreal
local c if lforce==1 & imf_adv==0  


local y pctusdinc
mixed `y' `x1'##c.mfg_pctexp `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
est sto t1_1

local y pctusdinc
mixed `y' c.reled3##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
est sto t1_2


local y loginc
mixed `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
est sto t1_3

local y loginc
local x2 c.lnproj_mfg
mixed `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
est sto t1_4

// Drop china
local z i.bach i.female age i.unemp  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local x2 c.lnreal
local c if lforce==1 & imf_adv==0  & countrystd~="China"

local y pctusdinc
mixed `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode:  , vce(cluster ccode)  mle variance
est sto t1_5

local y pctusdinc
local x2 c.lnproj_mfg
mixed `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode:  , vce(cluster ccode)  mle variance
est sto t1_6



// Table A8
   
est drop _all

// Alternative measures of IVs

local z  i.bach i.female age i.unemp   new_lngdppc lnnat lnpop i.year
local c if lforce==1 & imf_adv==0  

local x1  c.reled
local x2 c.mfg_pctexp
local y melogit support
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t3_1 

local x1  c.reled3
local x2 c.lnreal
local y melogit support
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t3_2

local x1  c.reled
local x2 c.mfg_proj_pct
local y melogit fdi_gr_bin
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode) 
est sto t3_3


local x1  c.reled3
local x2 c.lnproj_mfg
local y melogit fdi_gr_bin
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode) 
est sto t3_4


 // Table A9
 


/* Support glob */
local x1  c.reled
local x2 c.lnreal
local c if lforce==1 & imf_adv==0  

* Drop BACH
local y melogit support
local z   i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_1

* Drop population, GDPPC
local z  i.bach  i.female age i.unemp   lnnat   i.year  
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_2

* Drop China
local z  i.bach  i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
local c if lforce==1 & imf_adv==0  & countrystd~="China"
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_3

/* Support FDI */
local x2 c.lnproj_mfg
local x1  c.reled
local c if lforce==1 & imf_adv==0  

local y melogit fdi_gr_bin
local z   i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_4

local z  i.bach  i.female age i.unemp   lnnat   i.year  
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_5


local z  i.bach  i.female age i.unemp  new_lngdppc lnnat lnpop i.year  
local c if lforce==1 & imf_adv==0  & countrystd~="China"
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t4_6




  
// Table A10


// Further trade attitudes


est drop _all


local z i.female age i.unemp i.bach  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local x2 c.lnreal
local c if lforce==1 & imf_adv==0  

local y meologit tr_pr
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_1

local y meologit tr_wg
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_2

local y meologit tr_jb
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t2_3



// Table A11
  
// Developed and developing
est drop _all


local z i.bach i.female age i.unemp i.bach  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local x2 c.lnreal
local c if lforce==1  

local y pctusdinc

mixed `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)  mle variance
est sto t_1


// DV 2: Support for trade



local z i.bach i.female age i.unemp i.bach  new_lngdppc lnnat lnpop i.year
local x1  c.reled
local x2 c.lnreal
local c if lforce==1  

local y melogit support
 `y' `x1'##`x2' `z'   `c' [pw=weight] || ccode: , vce(cluster ccode)   
est sto t_2

